import Mathlib.Data.Vector import Mathlib.Data.Bitvec.Basic import Mathlib.Algebra.Group.InjSurj import Mathlib.Tactic.Ring import Mathlib.Data.Int.Cast.Lemmas import Mathlib.Data.ZMod.Basic import Mathlib.Order.Basic namespace Vector instance {ฮฑ :ฮฑ: Type uType u} {Type u: Type (u+1)n :n: โNat} : GetElem (VectorNat: Typeฮฑฮฑ: Type un) (Finn: โn)n: โฮฑ (funฮฑ: Type u__: ?m.11_ =>_: ?m.14True) where getElem := funTrue: Propvv: ?m.45ii: ?m.48_ =>_: ?m.51v.1[v: ?m.45i.val] @[simp] theorem getElem_eq_get {i: ?m.48ฮฑ :ฮฑ: Type uType u} {Type u: Type (u+1)n :n: โNat} (Nat: Typev : Vectorv: Vector ฮฑ nฮฑฮฑ: Type un) (n: โi : Fini: Fin nn) :n: โv[v: Vector ฮฑ ni] =i: Fin nv.getv: Vector ฮฑ ni := rfl end Vector namespace Bitvec def width : Bitveci: Fin nn โn: ?m.869Nat := funNat: Type_ =>_: ?m.877n -- Shouldn't this be inferred from the instance above? (as Bitvec is @[reducible]) instance {n: โn :n: โNat} : GetElem (BitvecNat: Typen) (Finn: โn)n: โBool (funBool: Type__: ?m.919_ =>_: ?m.922True) where getElem := funTrue: Propvv: ?m.948ii: ?m.951_ =>_: ?m.954v.1[v: ?m.948i.val] instance (i: ?m.951n :n: โNat) : Inhabited (BitvecNat: Typen) := โจList.replicaten: โnn: โtrue,true: BoolGoals accomplished! ๐n: โList.length (List.replicate n true) = nโฉ defGoals accomplished! ๐Fun (Fun: (width : โ) โ ?m.1584 widthwidth :width: โNat) := FinNat: Typewidth โwidth: โBool def ofInt' (Bool: Typen :n: โNat) (Nat: Typez :z: โคInt) : BitvecInt: Typen := matchn: โn with |n: โ0 => โจList.nil, rflโฉ |0: โm + 1 => Bitvec.ofIntm: โmm: โz /-- convert `Bitvec n` to `Fin n โ Bool` -/ def ofFun {z: โคwidth :width: โNat} : FunNat: Typewidth โ Bitvecwidth: โwidth := Vector.ofFn /-- convert `Fin n โ Bool` to `Bitvec n` -/ def toFun {width: โwidth :width: โNat} : BitvecNat: Typewidth โ Funwidth: โwidth := Vector.get instance {width: โwidth :width: โNat} :Nat: TypeCoe (FunCoe: semiOutParam (Sort ?u.2016) โ Sort ?u.2015 โ Sort (max(max1?u.2016)?u.2015)width) (Bitvecwidth: โwidth) := โจ@ofFunwidth: โwidthโฉ instance {width: โwidth :width: โNat} :Nat: TypeCoe (BitvecCoe: semiOutParam (Sort ?u.2097) โ Sort ?u.2096 โ Sort (max(max1?u.2097)?u.2096)width) (Funwidth: โwidth) := โจ@toFunwidth: โwidthโฉ def ofVector : Vectorwidth: โBoolBool: Typen โ Bitvecn: ?m.2175n :=n: ?m.2175id -- inspired by: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Defining.20my.20own.20numerals -- not ideal solution, as hard to type, but should be ok for now prefix:max "๐ถ" => fun v => ofVector (Vector.consid: {ฮฑ : Sort ?u.2185} โ ฮฑ โ ฮฑfalse v) prefix:max "๐ท" => fun v => ofVector (Vector.consfalse: Booltrue v) notation:max "๐ถ" => ofVector (Vector.construe: Boolfalse (@Vector.nilfalse: BoolBool)) notation:max "๐ท" => ofVector (Vector.consBool: Typetrue (@Vector.niltrue: BoolBool)) instance : Add (BitvecBool: Typen) where add := Bitvec.add instance : Sub (Bitvecn: ?m.125079n) where sub := Bitvec.sub -- examples: -- #eval (๐ท๐ถ๐ท๐ท).toNat -- #eval (๐ถ๐ท๐ท๐ท).toNat -- #eval (๐ถ๐ท๐ท๐ท) + (๐ท๐ถ๐ท๐ท) |>.toNat -- #eval ๐ท๐ถ๐ท๐ท + ๐ถ๐ท๐ท๐ท -- #eval Bitvec.adc (๐ท๐ถ๐ท๐ท) (๐ถ๐ท๐ท๐ท) true -- #eval Bitvec.adc (๐ท๐ถ๐ท๐ท) (๐ถ๐ท๐ท๐ท) false -- #eval Bitvec.adc (๐ท๐ถ๐ท๐ท) (๐ถ๐ท๐ท๐ท) true |>.toNat -- #eval Bitvec.adc (๐ท๐ถ๐ท๐ท) (๐ถ๐ท๐ท๐ท) false |>.toNat -- -- #eval Bitvec.adc (๐ถ) (๐ถ) true -- #eval Bitvec.adc (๐ถ) (๐ถ) false def toZMod {n: ?m.125173n :n: โNat} (Nat: Typex : Bitvecx: Bitvec nn) : ZMod (n: โ2 ^2: ?m.125273n) :=n: โx.toNat theorem toZMod_val {x: Bitvec nn :n: โโ} (โ: Typev : Bitvecv: Bitvec nn) : (toZModn: โv).val =v: Bitvec nv.toNat :=v: Bitvec nGoals accomplished! ๐ZMod.val โ(Bitvec.toNat v) = Bitvec.toNat vBitvec.toNat v % 2 ^ n = Bitvec.toNat vBitvec.toNat v < 2 ^ nBitvec.toNat v < 2 ^ ndef ofZMod {Goals accomplished! ๐n :n: โโ} (x : ZMod (โ: Type2 ^2: ?m.126030n)) : Bitvecn: โn := Bitvec.ofNatn: โ_ x.val theorem toZMod_ofZMod {_: โn} (i : ZMod <|n: ?m.1261872 ^2: ?m.126194n) : (ofZMod i).toZMod = i :=n: ?m.126187ZMod.val_injectiveZMod.val_injective: โ (n : โ) [inst : NeZero n], Function.Injective ZMod.val_ (_: โGoals accomplished! ๐) theorem ofZMod_toZMod {Goals accomplished! ๐n} (n: โv : Bitvecv: Bitvec nn) : ofZMod (toZModn: ?m.126586v) =v: Bitvec nv :=v: Bitvec nGoals accomplished! ๐Bitvec.ofNat n (Bitvec.toNat v) = vtheoremGoals accomplished! ๐foldl_addLsb_add : โ (foldl_addLsb_add: โ (n k : โ) (x : List Bool), List.foldl addLsb (n + k) x = 2 ^ List.length x * k + List.foldl addLsb n xnn: โk :k: โโ) (x : Listโ: TypeBool), x.foldl addLsb (Bool: Typen +n: โk) =k: โ2 ^ x.length *2: ?m.126739k + x.foldl addLsbk: โn |n: โn,n: โk, [] =>k: โGoals accomplished! ๐n, k: โList.foldl addLsb (n + k) [] = 2 ^ List.length [] * k + List.foldl addLsb n []|Goals accomplished! ๐n,n: โk,k: โa::l =>a: BoolGoals accomplished! ๐Goals accomplished! ๐Goals accomplished! ๐theoremGoals accomplished! ๐foldl_addLsb_eq_add_foldl_addLsb_zero (x : Listfoldl_addLsb_eq_add_foldl_addLsb_zero: โ (x : List Bool) (k : โ), List.foldl addLsb k x = 2 ^ List.length x * k + List.foldl addLsb 0 xBool) (Bool: Typek :k: โโ) : x.foldl addLsbโ: Typek =k: โ2 ^ x.length *2: ?m.129399k + x.foldl addLsbk: โ0 :=0: ?m.129428Goals accomplished! ๐List.foldl addLsb k x = 2 ^ List.length x * k + List.foldl addLsb 0 xList.foldl addLsb k x = 2 ^ List.length x * k + List.foldl addLsb 0 xList.foldl addLsb k x = List.foldl addLsb (0 + k) xList.foldl addLsb k x = 2 ^ List.length x * k + List.foldl addLsb 0 xList.foldl addLsb k x = List.foldl addLsb k xtheoremGoals accomplished! ๐foldl_addLsb_cons_zero (foldl_addLsb_cons_zero: โ (a : Bool) (x : List Bool), List.foldl addLsb 0 (a :: x) = (2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 xa :a: BoolBool) (x : ListBool: TypeBool) : (Bool: Typea::x).a: Boolfoldl addLsb0 =0: ?m.1297432^x.length * cond2: ?m.129763aa: Bool11: ?m.1297790 + x.foldl addLsb0: ?m.1297890 := calc (0: ?m.129812a::x).a: Boolfoldl addLsb0 = x.foldl addLsb (0: ?m.1299800 +0: ?m.1300040 + cond0: ?m.130015aa: Bool11: ?m.1300280) := rfl0: ?m.130038_ =_: ?mโ_ :=_: ?m.130163Goals accomplished! ๐List.foldl addLsb (0 + 0 + bif a then 1 else 0) x = (2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 xList.foldl addLsb (0 + 0 + bif a then 1 else 0) x = (2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 x(2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb (0 + 0) x = (2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 xtheoremGoals accomplished! ๐toNat_adc_aux : โ {x y: ListtoNat_adc_aux: โ {x y : List Bool}, List.length x = List.length y โ List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).snd = List.foldl addLsb 0 x + List.foldl addLsb 0 yBool} (Bool: Type_h : List.length x = List.length y), List.foldl addLsb (addLsb_h: List.length x = List.length y0 (List.mapAccumrโ (fun0: ?m.130298xx: ?m.130317yy: ?m.130320c => (Bitvec.carryc: ?m.130323xx: ?m.130317yy: ?m.130320c, Bitvec.xor3c: ?m.130323xx: ?m.130317yy: ?m.130320c)) x yc: ?m.130323false).fst) (List.mapAccumrโ (funfalse: Boolxx: ?m.130354yy: ?m.130357c => (Bitvec.carryc: ?m.130360xx: ?m.130354yy: ?m.130357c, Bitvec.xor3c: ?m.130360xx: ?m.130354yy: ?m.130357c)) x yc: ?m.130360false).snd = List.foldl addLsbfalse: Bool0 x + List.foldl addLsb0: ?m.1303940 y | [], [], _ => rfl |0: ?m.130407a::x,a: Boolb::y,b: Boolh =>h: List.length (a :: x) = List.length (b :: y)Goals accomplished! ๐List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = (2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 x + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = (2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 x + ((2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb 0 y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (List.foldl addLsb 0 x + List.foldl addLsb 0 y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).sndList.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry a b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).fst) (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry a b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).snd = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).sndList.foldl addLsb (addLsb 0 (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry a b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).fst) (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry a b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).snd = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).sndList.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst)) (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).sndList.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)List.foldl addLsb (addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst)) (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + List.foldl addLsb 0 (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).sndList.foldl addLsb (addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst)) (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).sndList.foldl addLsb (addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst)) (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)List.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd = List.foldl addLsb 0 (a :: x) + List.foldl addLsb 0 (b :: y)
false2 ^ List.length (xor (xor false b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (false && b || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif false then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
true2 ^ List.length (xor (xor true b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (true && b || true && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif true then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
false2 ^ List.length (xor (xor false b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (false && b || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif false then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
true2 ^ List.length (xor (xor true b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (true && b || true && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif true then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
false.false2 ^ List.length (xor (xor false false) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (false && false || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false false) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif false then 1 else 0) + 2 ^ List.length y * bif false then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
false.true2 ^ List.length (xor (xor false true) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (false && true || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || true && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false true) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif false then 1 else 0) + 2 ^ List.length y * bif true then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
false.false2 ^ List.length (xor (xor false false) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (false && false || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false false) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif false then 1 else 0) + 2 ^ List.length y * bif false then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
false.true2 ^ List.length (xor (xor false true) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (false && true || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || true && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false true) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif false then 1 else 0) + 2 ^ List.length y * bif true then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
true.false2 ^ List.length (xor (xor true false) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (true && false || true && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || false && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true false) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif true then 1 else 0) + 2 ^ List.length y * bif false then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
true.true2 ^ List.length (xor (xor true true) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (true && true || true && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || true && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true true) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif true then 1 else 0) + 2 ^ List.length y * bif true then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)Goals accomplished! ๐2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
false.true(2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) + ((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + ((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)
true.false(2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) + ((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + ((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
true.false.false(2 ^ List.length y * bif false then 0 else 1) + ((2 ^ List.length y * bif false then 1 else 0) + ((2 ^ List.length y * bif false then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif false then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)
true.false.true(2 ^ List.length y * bif true then 0 else 1) + ((2 ^ List.length y * bif true then 1 else 0) + ((2 ^ List.length y * bif true then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif true then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)
false.true.false(2 ^ List.length y * bif false then 0 else 1) + ((2 ^ List.length y * bif false then 1 else 0) + ((2 ^ List.length y * bif false then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif false then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)
false.true.true(2 ^ List.length y * bif true then 0 else 1) + ((2 ^ List.length y * bif true then 1 else 0) + ((2 ^ List.length y * bif true then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif true then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)
true.false.false(2 ^ List.length y * bif false then 0 else 1) + ((2 ^ List.length y * bif false then 1 else 0) + ((2 ^ List.length y * bif false then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif false then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)
true.false.true(2 ^ List.length y * bif true then 0 else 1) + ((2 ^ List.length y * bif true then 1 else 0) + ((2 ^ List.length y * bif true then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)) = 2 ^ List.length y + ((2 ^ List.length y * bif true then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor x (xor y c))) x y false).snd)2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) * addLsb 0 (a && b || a && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst) + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd) = ((2 ^ List.length x * bif a then 1 else 0) + 2 ^ List.length y * bif b then 1 else 0) + (2 ^ List.length (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd * addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).fst + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (x && y || x && c || y && c, xor (xor x y) c)) x y false).snd)theoremGoals accomplished! ๐toNat_adc {toNat_adc: โ {n : โ} {x y : Bitvec n}, Bitvec.toNat (adc x y false) = Bitvec.toNat x + Bitvec.toNat yn :n: โNat} {Nat: Typexx: Bitvec ny : Bitvecy: Bitvec nn} : (Bitvec.adcn: โxx: Bitvec nyy: Bitvec nfalse).toNat =false: Boolx.toNat +x: Bitvec ny.toNat :=y: Bitvec nGoals accomplished! ๐Bitvec.toNat (adc x y false) = Bitvec.toNat x + Bitvec.toNat y
mkBitvec.toNat (adc { val := x, property := hx } y false) = Bitvec.toNat { val := x, property := hx } + Bitvec.toNat yBitvec.toNat (adc x y false) = Bitvec.toNat x + Bitvec.toNat y
mk.mkBitvec.toNat (adc { val := x, property := hx } { val := y, property := hy } false) = Bitvec.toNat { val := x, property := hx } + Bitvec.toNat { val := y, property := hy }Bitvec.toNat (adc x y false) = Bitvec.toNat x + Bitvec.toNat y
mk.mkBitvec.toNat (adc { val := x, property := (_ : List.length x = List.length x) } { val := y, property := hy } false) = Bitvec.toNat { val := x, property := (_ : List.length x = List.length x) } + Bitvec.toNat { val := y, property := hy }Bitvec.toNat (adc x y false) = Bitvec.toNat x + Bitvec.toNat y
mk.mkList.foldl addLsb (addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).fst) (List.mapAccumrโ (fun x y c => (Bitvec.carry x y c, Bitvec.xor3 x y c)) x y false).snd = List.foldl addLsb 0 x + List.foldl addLsb 0 yBitvec.toNat (adc x y false) = Bitvec.toNat x + Bitvec.toNat ytheoremGoals accomplished! ๐toNat_tail : โ {toNat_tail: โ {n : โ} (x : Bitvec n), Bitvec.toNat (Vector.tail x) = Bitvec.toNat x % 2 ^ (n - 1)n :n: โNat} (Nat: Typex : Bitvecx: Bitvec nn), Bitvec.toNatn: โx.tail =x: Bitvec nx.toNat %x: Bitvec n2^(2: ?m.143528n-n: โ1) |1: ?m.1435410, โจ[], _โฉ => rfl |0: โn+n: โ1, โจ1: โa::l,a: Boolhโฉ =>h: List.length (a :: l) = n + 1Goals accomplished! ๐Bitvec.toNat (Vector.tail { val := a :: l, property := h }) = Bitvec.toNat { val := a :: l, property := h } % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := h }) = Bitvec.toNat { val := a :: l, property := h } % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := h })Bitvec.toNat (Vector.tail { val := a :: l, property := h }) % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := h }) % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := h }) = Bitvec.toNat { val := a :: l, property := h } % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := hโ }) % 2 ^ (n + 1 - 1) = Bitvec.toNat { val := a :: l, property := hโ } % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := h }) = Bitvec.toNat { val := a :: l, property := h } % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := h }) = Bitvec.toNat { val := a :: l, property := h } % 2 ^ (n + 1 - 1)Bitvec.toNat (Vector.tail { val := a :: l, property := h }) = Bitvec.toNat { val := a :: l, property := h } % 2 ^ (n + 1 - 1)List.foldl addLsb 0 l % 2 ^ n = List.foldl addLsb 0 l % 2 ^ n@[simp] theoremGoals accomplished! ๐toNat_add {toNat_add: โ {n : โ} (x y : Bitvec n), Bitvec.toNat (x + y) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ nn :n: โNat} (Nat: Typexx: Bitvec ny : Bitvecy: Bitvec nn) : (n: โx +x: Bitvec ny).toNat = (y: Bitvec nx.toNat +x: Bitvec ny.toNat) %y: Bitvec n2^2: ?m.146261n :=n: โGoals accomplished! ๐Bitvec.toNat (x + y) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ nBitvec.toNat (Vector.tail (adc x y false)) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ nBitvec.toNat (x + y) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ nBitvec.toNat (Vector.tail (adc x y false)) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ nBitvec.toNat (adc x y false) % 2 ^ (n + 1 - 1) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ nBitvec.toNat (Vector.tail (adc x y false)) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ n(Bitvec.toNat x + Bitvec.toNat y) % 2 ^ (n + 1 - 1) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ nBitvec.toNat (Vector.tail (adc x y false)) = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ n(Bitvec.toNat x + Bitvec.toNat y) % 2 ^ n = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ ntheorem toZMod_add {Goals accomplished! ๐n :n: โโ} (โ: Typexx: Bitvec ny : Bitvecy: Bitvec nn) : (n: โx +x: Bitvec ny).toZMod = (y: Bitvec nx.toZMod +x: Bitvec ny.toZMod) :=y: Bitvec nGoals accomplished! ๐
a(Bitvec.toNat x + Bitvec.toNat y) % 2 ^ n = (Bitvec.toNat x + ZMod.val (toZMod y)) % 2 ^ n
a(Bitvec.toNat x + Bitvec.toNat y) % 2 ^ n = (Bitvec.toNat x + Bitvec.toNat y) % 2 ^ ntheorem ofZMod_add {Goals accomplished! ๐n :n: โโ} (x y : ZMod (โ: Type2 ^2: ?m.147824n)) : Bitvec.ofZMod (x + y) = Bitvec.ofZMod x + Bitvec.ofZMod y :=n: โGoals accomplished! ๐theoremGoals accomplished! ๐zero_def : (zero_def: โ {n : โ}, 0 = { val := List.replicate n false, property := (_ : List.length โ0 = n) }0 : Bitvec0: ?m.148306n) = โจList.replicaten: ?m.148300nn: ?m.148300false, (false: Bool0 : Bitvec0: ?m.148354n).2โฉ := rfl theoremn: ?m.148300toList_zero : Vector.toList (toList_zero: โ {n : โ}, Vector.toList 0 = List.replicate n false0 : Bitvec0: ?m.148402n) = List.replicaten: ?m.148393nn: ?m.148393false := rfl @[simp] theoremfalse: BooltoNat_zero : โ {toNat_zero: โ {n : โ}, Bitvec.toNat 0 = 0n :n: โNat}, (Nat: Type0 : Bitvec0: ?m.148469n).toNat =n: โ0 |0: ?m.1485010 => rfl |0: โn+1 =>n: โGoals accomplished! ๐n: โBitvec.toNat 0 = 0theoremGoals accomplished! ๐ofNat_zero : Bitvec.ofNatofNat_zero: โ {w : โ}, Bitvec.ofNat w 0 = 0ww: ?m.1494050 =0: ?m.1494100 :=0: ?m.149421Goals accomplished! ๐w: โBitvec.ofNat w 0 = 0w: โBitvec.ofNat w 0 = 0w: โBitvec.ofNat w (Bitvec.toNat 0) = 0w: โw: โBitvec.ofNat w 0 = 0@[simp] theorem toZMod_zero : โ {Goals accomplished! ๐n :n: โNat}, (Nat: Type0 : Bitvec0: ?m.149495n).toZMod =n: โ0 :=0: ?m.149543Goals accomplished! ๐@[simp] theorem ofZMod_zero : Bitvec.ofZMod (Goals accomplished! ๐0 : ZMod (0: ?m.1514692^2: ?m.151397n)) =n: ?m.1513870 :=0: ?m.151772Goals accomplished! ๐theoremGoals accomplished! ๐toList_one {toList_one: โ {n : โ}, Vector.toList 1 = List.replicate n false ++ [true]n :n: โโ} : (โ: Type1 : Bitvec (1: ?m.151950n +n: โ1)).toList = List.replicate1: ?m.151889nn: โfalse ++ [false: Booltrue] := rfl theoremtrue: BooltoNat_one : โ {toNat_one: โ {n : โ}, Bitvec.toNat 1 = if n = 0 then 0 else 1n :n: โNat}, (Nat: Type1 : Bitvec1: ?m.152107n).toNat = ifn: โn =n: โ0 then0: ?m.1521400 else0: ?m.1521651 |1: ?m.1521760 => rfl |0: โ1 => rfl |1: โn+2 =>n: โGoals accomplished! ๐n: โBitvec.toNat 1 = if n + 2 = 0 then 0 else 1Bitvec.toNat 1 = if n + 2 = 0 then 0 else 1n: โBitvec.toNat 1 = if n + 2 = 0 then 0 else 1addLsb (List.foldl addLsb (addLsb 0 false) (List.replicate n false)) true = 1n: โBitvec.toNat 1 = if n + 2 = 0 then 0 else 1addLsb (List.foldl addLsb (addLsb 0 false) (List.replicate n false)) true = 1n: โBitvec.toNat 1 = if n + 2 = 0 then 0 else 1addLsb (List.foldl addLsb (addLsb 0 false) (List.replicate n false)) true = 1addLsb (2 ^ List.length (List.replicate n false) * addLsb 0 false + List.foldl addLsb 0 (List.replicate n false)) true = 1addLsb (List.foldl addLsb (addLsb 0 false) (List.replicate n false)) true = 1n: โBitvec.toNat 1 = if n + 2 = 0 then 0 else 1@[simp] theorem toZMod_one : โ {Goals accomplished! ๐n :n: โNat}, (Nat: Type1 : Bitvec1: ?m.155261n).toZMod =n: โ1 :=1: ?m.155309Goals accomplished! ๐@[simp] theorem ofZMod_one : Bitvec.ofZMod (Goals accomplished! ๐1 : ZMod (1: ?m.1594152^2: ?m.159343n)) =n: ?m.1593331 :=1: ?m.159628Goals accomplished! ๐instance : SMulGoals accomplished! ๐โ (Bitvecโ: Typen) := โจnsmulRecโฉ theorem nsmul_def {n: ?m.159740n :n: โโ} (โ: Typex : Bitvecx: Bitvec nn) (n: โy :y: โโ) :โ: Typey โขy: โx = nsmulRecx: Bitvec nyy: โx := rfl @[simp] theorem toZMod_nsmul {x: Bitvec nn :n: โโ} (โ: Typex : Bitvecx: Bitvec nn) (n: โy :y: โโ) : (โ: Typey โขy: โx).toZMod =x: Bitvec ny โขy: โx.toZMod :=x: Bitvec nGoals accomplished! ๐Goals accomplished! ๐Goals accomplished! ๐theoremGoals accomplished! ๐toInt_sub_aux : โ {x y : ListtoInt_sub_aux: โ {x y : List Bool}, List.length x = List.length y โ (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).fst then 1 else 0) = โ(List.foldl addLsb 0 x) + -โ(List.foldl addLsb 0 y)Bool} (Bool: Type_hx : List.length x = List.length y), (โ(List.foldl addLsb_hx: List.length x = List.length y0 (List.mapAccumrโ (fun0: ?m.164621xx: ?m.164640yy: ?m.164643c => (Bitvec.carry (!c: ?m.164646x)x: ?m.164640yy: ?m.164643c, Bitvec.xor3c: ?m.164646xx: ?m.164640yy: ?m.164643c)) x yc: ?m.164646false).snd) :false: Boolโค) -โค: Type2 ^ x.length * cond (List.mapAccumrโ (fun2: ?m.164725xx: ?m.164749yy: ?m.164752c => (Bitvec.carry (!c: ?m.164755x)x: ?m.164749yy: ?m.164752c, Bitvec.xor3c: ?m.164755xx: ?m.164749yy: ?m.164752c)) x yc: ?m.164755false).fstfalse: Bool11: ?m.1647760 = โ(List.foldl addLsb0: ?m.1647860 x) + -โ(List.foldl addLsb0: ?m.1651400 y) | [], [], _ => rfl |0: ?m.165184a::x,a: Boolb::y,b: Boolh =>h: List.length (a :: x) = List.length (b :: y)Goals accomplished! ๐(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ((2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 x) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ((2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 x) + -โ((2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb 0 y)(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + โ(List.foldl addLsb 0 x) + -โ((2 ^ List.length y * bif b then 1 else 0) + List.foldl addLsb 0 y)(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + โ(List.foldl addLsb 0 x) + -(โ(2 ^ List.length y * bif b then 1 else 0) + โ(List.foldl addLsb 0 y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + โ(List.foldl addLsb 0 x) + (-โ(2 ^ List.length y * bif b then 1 else 0) + -โ(List.foldl addLsb 0 y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 x) + -โ(List.foldl addLsb 0 y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).fst then 1 else 0)(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry (!a) b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).snd) - 2 ^ List.length (a :: x) * bif (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry (!a) b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).fst then 1 else 0)(โ(List.foldl addLsb 0 (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry (!a) b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).snd) - 2 ^ List.length (a :: x) * bif (let r := List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false; let q := (Bitvec.carry (!a) b r.fst, Bitvec.xor3 a b r.fst); (q.fst, q.snd :: r.snd)).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).fst then 1 else 0)(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))(โ(List.foldl addLsb 0 (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + List.foldl addLsb 0 (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(List.foldl addLsb 0 (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) (a :: x) (b :: y) false).fst then 1 else 0) = โ(List.foldl addLsb 0 (a :: x)) + -โ(List.foldl addLsb 0 (b :: y))
false(โ(2 ^ List.length (xor (xor false b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (false :: x) * bif !false && b || !false && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif false then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true(โ(2 ^ List.length (xor (xor true b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (true :: x) * bif !true && b || !true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif true then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false(โ(2 ^ List.length (xor (xor false b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (false :: x) * bif !false && b || !false && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif false then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true(โ(2 ^ List.length (xor (xor true b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (true :: x) * bif !true && b || !true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif true then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true.false(โ(2 ^ List.length (xor (xor true false) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true false) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (true :: x) * bif !true && false || !true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || false && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif true then 1 else 0) + -โ(2 ^ List.length y * bif false then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true.true(โ(2 ^ List.length (xor (xor true true) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true true) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (true :: x) * bif !true && true || !true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif true then 1 else 0) + -โ(2 ^ List.length y * bif true then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false.false(โ(2 ^ List.length (xor (xor false false) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false false) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (false :: x) * bif !false && false || !false && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || false && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif false then 1 else 0) + -โ(2 ^ List.length y * bif false then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false.true(โ(2 ^ List.length (xor (xor false true) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor false true) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (false :: x) * bif !false && true || !false && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif false then 1 else 0) + -โ(2 ^ List.length y * bif true then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true.false(โ(2 ^ List.length (xor (xor true false) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true false) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (true :: x) * bif !true && false || !true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || false && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif true then 1 else 0) + -โ(2 ^ List.length y * bif false then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true.true(โ(2 ^ List.length (xor (xor true true) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor true true) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (true :: x) * bif !true && true || !true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || true && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif true then 1 else 0) + -โ(2 ^ List.length y * bif true then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false.true-(2 ^ List.length y + 2 ^ List.length y) + (โ2 ^ List.length y * โ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd)) = -โ2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -(2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0))(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false.falseโ2 ^ List.length y * โ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + 2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0)) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -(2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0)
false.true-(2 ^ List.length y + 2 ^ List.length y) + (โ2 ^ List.length y * โ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd)) = -โ2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -(2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0))
true.falseโ2 ^ List.length y * โ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) = โ2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -(2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0))
true.trueโ2 ^ List.length y * โ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -((2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) + 2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0)) = โ2 ^ List.length y + (-โ2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -(2 ^ List.length y * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0)))(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true.falseโ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) * 2 ^ List.length y + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y + 2 ^ List.length y(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false.falseโ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y
false.trueโ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + (-((bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y) - 2 ^ List.length y)
true.falseโ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 0 else 1) * 2 ^ List.length y + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y + 2 ^ List.length y
true.trueโ(bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).fst then 1 else 0) * 2 ^ List.length y(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true.true.falseโ(bif false then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif false then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif false then 1 else 0) * 2 ^ List.length y
true.true.trueโ(bif true then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif true then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif true then 1 else 0) * 2 ^ List.length y(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false.false.falseโ(bif false then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif false then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif false then 1 else 0) * 2 ^ List.length y
false.false.trueโ(bif true then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif true then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif true then 1 else 0) * 2 ^ List.length y
false.true.falseโ(bif false then 0 else 1) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + (-((bif false then 1 else 0) * 2 ^ List.length y) - 2 ^ List.length y)
false.true.trueโ(bif true then 0 else 1) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + (-((bif true then 1 else 0) * 2 ^ List.length y) - 2 ^ List.length y)
true.false.falseโ(bif false then 0 else 1) * 2 ^ List.length y + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif false then 1 else 0) * 2 ^ List.length y + 2 ^ List.length y
true.false.trueโ(bif true then 0 else 1) * 2 ^ List.length y + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif true then 1 else 0) * 2 ^ List.length y + 2 ^ List.length y
true.true.falseโ(bif false then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif false then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif false then 1 else 0) * 2 ^ List.length y
true.true.trueโ(bif true then 1 else 0) * 2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif true then 1 else 0) * 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - (bif true then 1 else 0) * 2 ^ List.length y(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
true.true.true2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)
false.false.true2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y
false.true.false2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + -2 ^ List.length y
false.true.trueโ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2 = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + (-2 ^ List.length y - 2 ^ List.length y)
true.false.false2 ^ List.length y + โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) + 2 ^ List.length y
true.true.true2 ^ List.length y + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y * 2) = โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor x (xor y c))) x y false).snd) - 2 ^ List.length y(โ(2 ^ List.length (xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst :: (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) * 0 + ((2 ^ List.length (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd * bif xor (xor a b) (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd)) - 2 ^ List.length (a :: x) * bif !a && b || !a && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst || b && (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0) = โ(2 ^ List.length x * bif a then 1 else 0) + -โ(2 ^ List.length y * bif b then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (!x && y || !x && c || y && c, xor (xor x y) c)) x y false).fst then 1 else 0)instance (Goals accomplished! ๐n :n: โโ) : NeZero (โ: Type2 ^2: ?m.190210n) := โจNat.pos_iff_ne_zero.1 <| pow_pos (n: โGoals accomplished! ๐)Goals accomplished! ๐_โฉ theorem toZMod_sbb {_: โn :n: โโ} (โ: Typexx: Bitvec ny : Bitvecy: Bitvec nn) : (n: โx.sbbx: Bitvec nyy: Bitvec nfalse).2.toZMod =false: Boolx.toZMod -x: Bitvec ny.toZMod :=y: Bitvec nGoals accomplished! ๐
mk.mkโ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) = โ(List.foldl addLsb 0 x) - โ(List.foldl addLsb 0 y)
mk.mkโ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) = โ(List.foldl addLsb 0 x) - โ(List.foldl addLsb 0 y)Goals accomplished! ๐0 = 0Goals accomplished! ๐n: โ
x: List Bool
hx: List.length x = n
y: List Bool
hy: List.length y = n
h2n: 2 ^ n = 0
this: โ(โ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) - 2 ^ List.length x * bif (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).fst then 1 else 0) = โ(โ(List.foldl addLsb 0 x) + -โ(List.foldl addLsb 0 y))
mk.mkโ(List.foldl addLsb 0 (List.mapAccumrโ (fun x y c => (Bitvec.carry (!x) y c, Bitvec.xor3 x y c)) x y false).snd) = โ(List.foldl addLsb 0 x) - โ(List.foldl addLsb 0 y)theorem toZMod_sub {Goals accomplished! ๐n :n: โโ} (โ: Typexx: Bitvec ny : Bitvecy: Bitvec nn) : (n: โx -x: Bitvec ny).toZMod =y: Bitvec nx.toZMod -x: Bitvec ny.toZMod := toZMod_sbby: Bitvec nxx: Bitvec ny theoremy: Bitvec ntoInt_neg_aux : โ (x : ListtoInt_neg_aux: โ (x : List Bool), (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 x)Bool), ((List.foldl addLsb (Bool: Type0 :0: ?m.198642โ) (List.mapAccumr (funโ: Typeyy: ?m.198659c => (c: ?m.198662y ||y: ?m.198659c, xorc: ?m.198662yy: ?m.198659c)) xc: ?m.198662false).snd :false: Boolโ) -โ: Type2 ^ x.length * cond (List.mapAccumr (fun2: ?m.198690yy: ?m.198712c => (c: ?m.198715y ||y: ?m.198712c, xorc: ?m.198715yy: ?m.198712c)) xc: ?m.198715false).fstfalse: Bool11: ?m.1987340 :0: ?m.198744โค) = -(List.foldl addLsbโค: Type0 x) | [] => rfl |0: ?m.199147a::x =>a: BoolGoals accomplished! ๐(โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(List.foldl addLsb 0 (xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst :: (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(List.foldl addLsb 0 (xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst :: (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ((2 ^ List.length (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd * bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(List.foldl addLsb 0 (xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst :: (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ((2 ^ List.length (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd * bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ((2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 x)(โ(List.foldl addLsb 0 (xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst :: (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(2 ^ List.length (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd * bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ((2 ^ List.length x * bif a then 1 else 0) + List.foldl addLsb 0 x)(โ(List.foldl addLsb 0 (xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst :: (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(2 ^ List.length (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd * bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(โ(2 ^ List.length x * bif a then 1 else 0) + โ(List.foldl addLsb 0 x))(โ(List.foldl addLsb 0 (xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst :: (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(2 ^ List.length (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd * bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(2 ^ List.length x * bif a then 1 else 0) + -โ(List.foldl addLsb 0 x)(โ(List.foldl addLsb 0 (xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst :: (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(โ(2 ^ List.length (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd * bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(2 ^ List.length x * bif a then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)(โ(2 ^ List.length (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd * bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length (a :: x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -โ(2 ^ List.length x * bif a then 1 else 0) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)(โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))(2 ^ List.length x * โ(bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif a then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)(โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).snd) - 2 ^ List.length (a :: x) * bif (List.mapAccumr (fun y c => (y || c, xor y c)) (a :: x) false).fst then 1 else 0) = -โ(List.foldl addLsb 0 (a :: x))
false(2 ^ List.length x * โ(bif xor false (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif false || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif false then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)
true(2 ^ List.length x * โ(bif xor true (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif true || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif true then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)(2 ^ List.length x * โ(bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif a then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)
false(2 ^ List.length x * โ(bif xor false (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif false || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif false then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)
true(2 ^ List.length x * โ(bif xor true (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif true || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif true then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)(2 ^ List.length x * โ(bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif a then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)
true.false(2 ^ List.length x * โ(bif xor true false then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif true || false then 1 else 0) = -(2 ^ List.length x * โ(bif true then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif false then 1 else 0)
true.true(2 ^ List.length x * โ(bif xor true true then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif true || true then 1 else 0) = -(2 ^ List.length x * โ(bif true then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif true then 1 else 0)(2 ^ List.length x * โ(bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif a then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)
false.false(2 ^ List.length x * โ(bif xor false false then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif false || false then 1 else 0) = -(2 ^ List.length x * โ(bif false then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif false then 1 else 0)
false.true(2 ^ List.length x * โ(bif xor false true then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif false || true then 1 else 0) = -(2 ^ List.length x * โ(bif false then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif true then 1 else 0)
true.false(2 ^ List.length x * โ(bif xor true false then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif true || false then 1 else 0) = -(2 ^ List.length x * โ(bif true then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif false then 1 else 0)
true.true(2 ^ List.length x * โ(bif xor true true then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif true || true then 1 else 0) = -(2 ^ List.length x * โ(bif true then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif true then 1 else 0)(2 ^ List.length x * โ(bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif a then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)
false.true2 ^ List.length x + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) + (-2 ^ List.length x + -2 ^ List.length x) = โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) + -2 ^ List.length x(2 ^ List.length x * โ(bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif a then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)
false.true2 ^ List.length x + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) + (-2 ^ List.length x + -2 ^ List.length x) = โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) + -2 ^ List.length x
true.false2 ^ List.length x + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) + (-2 ^ List.length x + -2 ^ List.length x) = -2 ^ List.length x + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd)
true.trueโ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) + (-2 ^ List.length x + -2 ^ List.length x) = -2 ^ List.length x + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) + -2 ^ List.length x)(2 ^ List.length x * โ(bif xor a (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) + โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ Nat.succ (List.length x) * bif a || (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = -(2 ^ List.length x * โ(bif a then 1 else 0)) + (โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0)theorem toZMod_neg {Goals accomplished! ๐n :n: โโ} (โ: Typex : Bitvecx: Bitvec nn) : (-n: โx).toZMod = -x: Bitvec nx.toZMod :=x: Bitvec nGoals accomplished! ๐
mktoZMod (Bitvec.neg { val := x, property := hx }) = -toZMod { val := x, property := hx }
mkโ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) = -โ(List.foldl addLsb 0 x)
mkโ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) = -โ(List.foldl addLsb 0 x)Goals accomplished! ๐Goals accomplished! ๐n: โ
x: List Bool
hx: List.length x = n
h2n: 2 ^ n = 0
this: โ(โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = โ(-โ(List.foldl addLsb 0 x))
mkโ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) = -โ(List.foldl addLsb 0 x)x: List Bool
h2n: 2 ^ List.length x = 0
this: โ(โ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) - 2 ^ List.length x * bif (List.mapAccumr (fun y c => (y || c, xor y c)) x false).fst then 1 else 0) = โ(-โ(List.foldl addLsb 0 x))
mkโ(List.foldl addLsb 0 (List.mapAccumr (fun y c => (y || c, xor y c)) x false).snd) = -โ(List.foldl addLsb 0 x)instance : SMulGoals accomplished! ๐โค (Bitvecโค: Typen) := โจzsmulRecโฉ theorem zsmul_def {n: ?m.224303n :n: โโ} (โ: Typex : Bitvecx: Bitvec nn) (n: โy :y: โคโค) :โค: Typey โขy: โคx = zsmulRecx: Bitvec nyy: โคx := rfl @[simp] theorem toZMod_zsmul {x: Bitvec nn :n: โโ} (โ: Typex : Bitvecx: Bitvec nn) (n: โy :y: โคโค) : (โค: Typey โขy: โคx).toZMod =x: Bitvec ny โขy: โคx.toZMod :=x: Bitvec nGoals accomplished! ๐Goals accomplished! ๐
negSucctoZMod (Int.negSucc y โข x) = Int.negSucc y โข toZMod xGoals accomplished! ๐instance : AddCommGroup (Bitvecinstance: {n : โ} โ AddCommGroup (Bitvec n)n) :=n: ?m.229231Function.Injective.addCommGroup toZMod (Function.Injective.addCommGroup: {Mโ : Type ?u.229238} โ {Mโ : Type ?u.229237} โ [inst : Add Mโ] โ [inst_1 : Zero Mโ] โ [inst_2 : SMul โ Mโ] โ [inst_3 : Neg Mโ] โ [inst_4 : Sub Mโ] โ [inst_5 : SMul โค Mโ] โ [inst_6 : AddCommGroup Mโ] โ (f : Mโ โ Mโ) โ Function.Injective f โ f 0 = 0 โ (โ (x y : Mโ), f (x + y) = f x + f y) โ (โ (x : Mโ), f (-x) = -f x) โ (โ (x y : Mโ), f (x - y) = f x - f y) โ (โ (x : Mโ) (n : โ), f (n โข x) = n โข f x) โ (โ (x : Mโ) (n : โค), f (n โข x) = n โข f x) โ AddCommGroup MโFunction.injective_iff_hasLeftInverse.2 โจFunction.injective_iff_hasLeftInverse: โ {ฮฑ : Sort ?u.229670} {ฮฒ : Sort ?u.229671} [inst : Nonempty ฮฑ] {f : ฮฑ โ ฮฒ}, Function.Injective f โ Function.HasLeftInverse f_, ofZMod_toZModโฉ) toZMod_zero toZMod_add toZMod_neg toZMod_sub toZMod_nsmul toZMod_zsmul -- see https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Pattern.20matching.20subtypes def add? {_: ?m.229737n :n: โNat} (Nat: Typexx: Bitvec ny : Bitvecy: Bitvec nn) : Option (Bitvecn: โn) := match Bitvec.adcn: โxx: Bitvec nyy: Bitvec nfalse with | โจfalse: Boolfalse :: z,false: Boolhconsโฉ => some โจz,hcons: List.length (false :: z) = n + 1Goals accomplished! ๐โฉ | _ => none -- overflow theorem {Goals accomplished! ๐n :n: โNat} {Nat: Typexx: Bitvec nyy: Bitvec nz : Bitvecz: Bitvec nn} : add?n: โxx: Bitvec ny = somey: Bitvec nz โz: Bitvec nx +x: Bitvec ny =y: Bitvec nz :=z: Bitvec nsorry /- #eval (๐ท๐ถ๐ท๐ท).toNat * (๐ท๐ถ๐ท๐ท).toNat #eval Bitvec.mul (๐ท๐ถ๐ท๐ท) (๐ท๐ถ๐ท๐ท) |>.toNat -/ protected def mul? {sorry: ?m.231468n :n: โNat} (Nat: Typexx: Bitvec ny : Bitvecy: Bitvec nn) : Option (Bitvecn: โn) := do letn: โff: (r : ?m.231507) โ (b : ?m.231515 r) โ ?m.231516 r brr: ?m.231507b := do letb: ?m.231510opโ โ Bitvec.add?opโ: ?m.231674rr: ?m.231507r letr: ?m.231507opโ โ Bitvec.add?opโ: ?m.231723opโopโ: ?m.231674y return condy: Bitvec nbb: ?m.231510opโopโ: ?m.231723opโ (opโ: ?m.231674x.toList).x: Bitvec nfoldlMff: (r : ?m.231507) โ (b : ?m.231515 r) โ ?m.231516 r b0 /- #eval Bitvec.mul? (๐ท๐ถ๐ท๐ท) (๐ท๐ถ๐ท๐ท) #eval Bitvec.mul? (๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ท๐ถ๐ท๐ท) (๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ท๐ถ๐ท๐ท) |>.get!|>.toNat -/ theorem : โ {0: ?m.231587n :n: โNat} {Nat: Typexx: Bitvec nyy: Bitvec nz : Bitvecz: Bitvec nn}, Bitvec.mul?n: โxx: Bitvec ny = somey: Bitvec nz โz: Bitvec nx *x: Bitvec ny =y: Bitvec nz :=z: Bitvec nsorry /-- The value produced is the unsigned integer quotient of the two operands. Note that unsigned integer division and signed integer division are distinct operations; for signed integer division, use โsdivโ. Division by zero is undefined behavior. -/ def udiv? {sorry: ?m.232282w :w: โNat} (Nat: Typexx: Bitvec wy : Bitvecy: Bitvec ww) : Option $ Bitvecw: โw := matchw: โy.toNat with |y: Bitvec w0 => none | _ => some $ Bitvec.ofNat0: โw (w: โx.toNat /x: Bitvec wy.toNat) /-- The value produced is the signed integer quotient of the two operands rounded towards zero. Note that signed integer division and unsigned integer division are distinct operations; for unsigned integer division, use โudivโ. Division by zero is undefined behavior. Overflow also leads to undefined behavior; this is a rare case, but can occur, for example, by doing a 32-bit division of -2147483648 by -1. -/ def sdiv? {y: Bitvec ww :w: โNat} (Nat: Typexx: Bitvec wy : Bitvecy: Bitvec ww) : Option $ Bitvecw: โw := ifw: โy.toInt =y: Bitvec w0 then none else let0: ?m.232673div := (div: ?m.232715x.toInt /x: Bitvec wy.toInt) ify: Bitvec wdiv <div: ?m.2327152^2: ?m.232782w then some $ Bitvec.ofInt'w: โww: โdiv else none /-- This instruction returns the unsigned integer remainder of a division. This instruction always performs an unsigned division to get the remainder. Note that unsigned integer remainder and signed integer remainder are distinct operations; for signed integer remainder, use โsremโ. Taking the remainder of a division by zero is undefined behavior. -/ def urem? {div: ?m.232715w :w: โNat} (Nat: Typexx: Bitvec wy : Bitvecy: Bitvec ww) : Option $ Bitvecw: โw := ifw: โy.toNat =y: Bitvec w0 then none else some $ Bitvec.ofNat0: ?m.233359w (w: โx.toNat %x: Bitvec wy.toNat) def _root_.Int.rem (y: Bitvec wxx: โคy :y: โคInt) :Int: TypeInt := ifInt: Typex โฅx: โค0 then (0: ?m.233574x %x: โคy) else ((y: โคx %x: โคy) - |y: โคy|) -- TODO: prove this to make sure it's the right implementation! theorem : โy: โคxx: ?m.234142y, Int.remy: ?m.234145xx: ?m.234142y <y: ?m.2341450 โ0: ?m.234150x <x: ?m.2341420 :=0: ?m.234180Goals accomplished! ๐/-- This instruction returns the remainder of a division (where the result is either zero or has the same sign as the dividend, op1), not the modulo operator (where the result is either zero or has the same sign as the divisor, op2) of a value. For more information about the difference, see The Math Forum. For a table of how this is implemented in various languages, please see Wikipedia: modulo operation. Note that signed integer remainder and unsigned integer remainder are distinct operations; for unsigned integer remainder, use โuremโ. Taking the remainder of a division by zero is undefined behavior. For vectors, if any element of the divisor is zero, the operation has undefined behavior. Overflow also leads to undefined behavior; this is a rare case, but can occur, for example, by taking the remainder of a 32-bit division of -2147483648 by -1. (The remainder doesnโt actually overflow, but this rule lets srem be implemented using instructions that return both the result of the division and the remainder.) -/ def srem? {Goals accomplished! ๐w :w: โNat} (Nat: Typexx: Bitvec wy : Bitvecy: Bitvec ww) : Option $ Bitvecw: โw := ifw: โy.toInt =y: Bitvec w0 then none else let0: ?m.234223div := (div: ?m.234265x.toInt /x: Bitvec wy.toInt) ify: Bitvec wdiv <div: ?m.2342652^2: ?m.234332w then some $ Bitvec.ofInt'w: โw (w: โx.toInt.remx: Bitvec wy.toInt) else none /-- If the condition is an i1 and it evaluates to 1, the instruction returns the first value argument; otherwise, it returns the second value argument. -/ def select {y: Bitvec ww :w: โNat} (Nat: Typec : Bitvecc: Bitvec 11) (1: ?m.234884xx: Bitvec wy : Bitvecy: Bitvec ww) : Bitvecw: โw := condw: โc.headc: Bitvec 1xx: Bitvec wy theorem bitwise_eq_eq {y: Bitvec ww :w: โNat} {Nat: Typexx: Bitvec wy : Bitvecy: Bitvec ww} : (forallw: โi : Fini: Fin ww,w: โx[x: Bitvec wi] =i: Fin wy[y: Bitvec wi]) โi: Fin wx =x: Bitvec wy := โจy: Bitvec wVector.ext, funVector.ext: โ {n : โ} {ฮฑ : Type ?u.235387} {v w : Vector ฮฑ n}, (โ (m : Fin n), Vector.get v m = Vector.get w m) โ v = whh: ?m.235422_ =>_: ?m.235425h โธ rflโฉ theoremh: ?m.235422ext_get? {ext_get?: โ {w : โ} {x y : Bitvec w}, (โ (i : โ), List.get? (Vector.toList x) i = List.get? (Vector.toList y) i) โ x = yw :w: โNat} {Nat: Typexx: Bitvec wy : Bitvecy: Bitvec ww} (w: โh : โh: โ (i : โ), List.get? (Vector.toList x) i = List.get? (Vector.toList y) ii,i: ?m.235461x.toList.get?x: Bitvec wi =i: ?m.235461y.toList.get?y: Bitvec wi) :i: ?m.235461x =x: Bitvec wy :=y: Bitvec wGoals accomplished! ๐x = yx: List Bool
y: Bitvec (List.length x)
h: โ (i : โ), List.get? (Vector.toList { val := x, property := (_ : List.length x = List.length x) }) i = List.get? (Vector.toList y) i
mk{ val := x, property := (_ : List.length x = List.length x) } = yx = yx, y: List Bool
hy: List.length y = List.length x
h: โ (i : โ), List.get? (Vector.toList { val := x, property := (_ : List.length x = List.length x) }) i = List.get? (Vector.toList { val := y, property := hy }) i
mk.mk{ val := x, property := (_ : List.length x = List.length x) } = { val := y, property := hy }x = y@[simp] theoremGoals accomplished! ๐toList_cong {toList_cong: โ {wโ wโ : โ} (h : wโ = wโ) (b : Bitvec wโ), Vector.toList (Bitvec.cong h b) = Vector.toList bwโwโ: โwโ :wโ: โNat} (Nat: Typeh :h: wโ = wโwโ =wโ: โwโ) (wโ: โb : Bitvecb: Bitvec wโwโ) : (Bitvec.congwโ: โhh: wโ = wโb).toList =b: Bitvec wโb.toList :=b: Bitvec wโGoals accomplished! ๐Vector.toList (Bitvec.cong h b) = Vector.toList bVector.toList (Bitvec.cong (_ : wโ = wโ) b) = Vector.toList bVector.toList (Bitvec.cong (_ : wโ = wโ) b) = Vector.toList bVector.toList (Bitvec.cong h b) = Vector.toList btheoremGoals accomplished! ๐get?_shl (x : Bitvecx: Bitvec nn) (n: ?m.235708ii: โj :j: โโ) : (โ: Typex.shlx: Bitvec ni).toList.get?i: โj = ifj: โi +i: โj <j: โn thenn: ?m.235708x.toList.get? (x: Bitvec ni +i: โj) else ifj: โj <j: โn thenn: ?m.235708false else none :=false: BoolGoals accomplished! ๐List.get? (Vector.toList (Bitvec.cong (_ : n - i + min n i = n) (Vector.append (Vector.drop i x) (Vector.replicate (min n i) false)))) j = if i + j < n then List.get? (Vector.toList x) (i + j) else if j < n then some false else none
mkList.get? (Vector.toList (Bitvec.cong (_ : List.length x - i + min (List.length x) i = List.length x) (Vector.append (Vector.drop i { val := x, property := (_ : List.length x = List.length x) }) (Vector.replicate (min (List.length x) i) false)))) j = if i + j < List.length x then List.get? (Vector.toList { val := x, property := (_ : List.length x = List.length x) }) (i + j) else if j < List.length x then some false else none
mkList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = if i + j < List.length x then List.get? x (i + j) else if j < List.length x then some false else none
mk.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = List.get? x (i + j)
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = List.get? x (i + j)
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inlj < List.length (List.drop i x)
mk.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = List.get? x (i + j)
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inlj < List.length (List.drop i x)
mk.inlj < List.length (List.drop i x)
mk.inlj < List.length (List.drop i x)
mk.inlj < List.length x - i
mk.inlj < List.length x - i
mk.inlj < List.length (List.drop i x)Goals accomplished! ๐
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inlList.get? (List.replicate (min (List.length x) i) false) (j - List.length (List.drop i x)) = some false
mk.inr.inlList.length (List.drop i x) โค j
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inlsome (List.get (List.replicate (min (List.length x) i) false) { val := j - List.length (List.drop i x), isLt := ?mk.inr.inl }) = some false
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlList.length (List.drop i x) โค j
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inl
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlList.length (List.drop i x) โค j
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlList.length (List.drop i x) โค j
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)
mk.inr.inlList.length (List.drop i x) โค j
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)Goals accomplished! ๐List.length (List.drop i x) โค jGoals accomplished! ๐
mk.inr.inlj - List.length (List.drop i x) < List.length (List.replicate (min (List.length x) i) false)Goals accomplished! ๐j < List.length (List.drop i x) + List.length (List.replicate (min (List.length x) i) false)Goals accomplished! ๐Goals accomplished! ๐
mk.inr.inlList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = some false
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inlList.length (List.drop i x) โค j
mk.inr.inlList.length (List.drop i x) โค jGoals accomplished! ๐
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = none
mk.inr.inrList.length (List.drop i x ++ List.replicate (min (List.length x) i) false) โค j
mk.inr.inrList.length (List.drop i x ++ List.replicate (min (List.length x) i) false) โค j
mk.inr.inrList.get? (List.drop i x ++ List.replicate (min (List.length x) i) false) j = noneGoals accomplished! ๐theoremGoals accomplished! ๐get?_ushr (get?_ushr: โ {n : โ} (x : Bitvec n) (i j : โ), List.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else nonex : Bitvecx: Bitvec nn) (n: ?m.243301ii: โj :j: โโ) : (โ: Typex.ushrx: Bitvec ni).toList.get?i: โj = ifj: โj <j: โx.length then ifx: Bitvec nj <j: โi then somei: โfalse elsefalse: Boolx.toList.get? (x: Bitvec nj -j: โi) else none :=i: โGoals accomplished! ๐List.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else noneList.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else none
mkList.get? (Vector.toList (fillShr { val := x, property := (_ : List.length x = List.length x) } i false)) j = if j < Vector.length { val := x, property := (_ : List.length x = List.length x) } then if j < i then some false else List.get? (Vector.toList { val := x, property := (_ : List.length x = List.length x) }) (j - i) else noneList.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else none
mkList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = if j < Vector.length { val := x, property := (_ : List.length x = List.length x) } then if j < i then some false else List.get? x (j - i) else noneList.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = noneList.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlsome (List.get (List.replicate (min (List.length x) i) false) { val := j, isLt := ?mk.inl.inl }) = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inli, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)Goals accomplished! ๐i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = some falsei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: j < i
mk.inl.inlj < List.length (List.replicate (min (List.length x) i) false)Goals accomplished! ๐i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = noneList.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? (List.replicate i false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? (List.take (List.length x - i) x) (j - List.length (List.replicate i false)) = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.length (List.replicate i false) โค ji, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? x (j - List.length (List.replicate i false)) = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrj - List.length (List.replicate i false) < List.length x - ii, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.length (List.replicate i false) โค ji, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.get? x (j - List.length (List.replicate i false)) = List.get? x (j - i)i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrj - List.length (List.replicate i false) < List.length x - ii, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.length (List.replicate i false) โค ji, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrj - List.length (List.replicate i false) < List.length x - ii, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.length (List.replicate i false) โค ji, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrj - List.length (List.replicate i false) < List.length x - ii, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrj - List.length (List.replicate i false) < List.length x - ii, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.length (List.replicate i false) โค ji, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrj - List.length (List.replicate i false) < List.length x - iGoals accomplished! ๐i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length xList.length (List.replicate i false) โค jGoals accomplished! ๐i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrj - List.length (List.replicate i false) < List.length x - iGoals accomplished! ๐i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length xj < List.length (List.replicate i false) + (List.length x - i)Goals accomplished! ๐Goals accomplished! ๐i, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
mk.inl.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = List.get? x (j - i)i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.length (List.replicate i false) โค ji, j: โ
x: List Bool
hโ: j < Vector.length { val := x, property := (_ : List.length x = List.length x) }
hโ: ยฌj < i
this: i < List.length x
mk.inl.inrList.length (List.replicate i false) โค jGoals accomplished! ๐i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = noneList.get? (Vector.toList (ushr x i)) j = if j < Vector.length x then if j < i then some false else List.get? (Vector.toList x) (j - i) else nonei, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.get? (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) j = nonei, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (if List.length x โค i then List.length x else i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (if List.length x โค i then List.length x else i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: List.length x โค i
mk.inr.inlList.length (List.replicate (List.length x) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: ยฌList.length x โค i
mk.inr.inrList.length (List.replicate i false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: List.length x โค i
mk.inr.inlList.length (List.replicate (List.length x) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: List.length x โค i
mk.inr.inlList.length (List.replicate (List.length x) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: ยฌList.length x โค i
mk.inr.inrList.length (List.replicate i false ++ List.take (List.length x - i) x) โค jGoals accomplished! ๐i, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: ยฌList.length x โค i
mk.inr.inrList.length (List.replicate i false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
mk.inrList.length (List.replicate (min (List.length x) i) false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: ยฌList.length x โค i
mk.inr.inrList.length (List.replicate i false ++ List.take (List.length x - i) x) โค ji, j: โ
x: List Bool
hโ: ยฌj < Vector.length { val := x, property := (_ : List.length x = List.length x) }
h: ยฌList.length x โค i
mk.inr.inrList.length (List.replicate i false ++ List.take (List.length x - i) x) โค jGoals accomplished! ๐Goals accomplished! ๐theoremGoals accomplished! ๐get?_and (get?_and: โ {n : โ} (x y : Bitvec n) (i : โ), List.get? (Vector.toList (Bitvec.and x y)) i = do let __do_lift โ List.get? (Vector.toList x) i let __do_lift_1 โ List.get? (Vector.toList y) i pure (__do_lift && __do_lift_1)xx: Bitvec ny : Bitvecy: Bitvec nn) (n: ?m.261838i :i: โโ) : (โ: Typex.andx: Bitvec ny).toList.get?y: Bitvec ni = do returni: โ(โ(โ x.toList.get? i): ?m.261941xx: Bitvec n.toList(โ x.toList.get? i): ?m.261941.get?(โ x.toList.get? i): ?m.261941(โ x.toList.get? i): ?m.261941ii: โ) &&(โ x.toList.get? i): ?m.261941(โ(โ y.toList.get? i): ?m.261997yy: Bitvec n.toList(โ y.toList.get? i): ?m.261997.get?(โ y.toList.get? i): ?m.261997(โ y.toList.get? i): ?m.261997ii: โ) :=(โ y.toList.get? i): ?m.261997Goals accomplished! ๐List.get? (Vector.toList (Bitvec.and x y)) i = do let __do_lift โ List.get? (Vector.toList x) i let __do_lift_1 โ List.get? (Vector.toList y) i pure (__do_lift && __do_lift_1)
mkList.get? (Vector.toList (Bitvec.and { val := x, property := (_ : List.length x = List.length x) } y)) i = do let __do_lift โ List.get? (Vector.toList { val := x, property := (_ : List.length x = List.length x) }) i let __do_lift_1 โ List.get? (Vector.toList y) i pure (__do_lift && __do_lift_1)List.get? (Vector.toList (Bitvec.and x y)) i = do let __do_lift โ List.get? (Vector.toList x) i let __do_lift_1 โ List.get? (Vector.toList y) i pure (__do_lift && __do_lift_1)
mk.mkList.get? (Vector.toList (Bitvec.and { val := x, property := (_ : List.length x = List.length x) } { val := y, property := hy })) i = do let __do_lift โ List.get? (Vector.toList { val := x, property := (_ : List.length x = List.length x) }) i let __do_lift_1 โ List.get? (Vector.toList { val := y, property := hy }) i pure (__do_lift && __do_lift_1)List.get? (Vector.toList (Bitvec.and x y)) i = do let __do_lift โ List.get? (Vector.toList x) i let __do_lift_1 โ List.get? (Vector.toList y) i pure (__do_lift && __do_lift_1)
mk.mk(Option.bind (Option.map and (List.get? x i)) fun g => Option.map g (List.get? y i)) = do let __do_lift โ List.get? x i let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)List.get? (Vector.toList (Bitvec.and x y)) i = do let __do_lift โ List.get? (Vector.toList x) i let __do_lift_1 โ List.get? (Vector.toList y) i pure (__do_lift && __do_lift_1)
mk.mk.none(Option.bind (Option.map and none) fun g => Option.map g (List.get? y i)) = do let __do_lift โ none let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)
mk.mk.some(Option.bind (Option.map and (some valโ)) fun g => Option.map g (List.get? y i)) = do let __do_lift โ some valโ let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)
mk.mk(Option.bind (Option.map and (List.get? x i)) fun g => Option.map g (List.get? y i)) = do let __do_lift โ List.get? x i let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)
mk.mk.none(Option.bind (Option.map and none) fun g => Option.map g (List.get? y i)) = do let __do_lift โ none let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)
mk.mk.some(Option.bind (Option.map and (some valโ)) fun g => Option.map g (List.get? y i)) = do let __do_lift โ some valโ let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)
mk.mk(Option.bind (Option.map and (List.get? x i)) fun g => Option.map g (List.get? y i)) = do let __do_lift โ List.get? x i let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)
mk.mk.some.none(Option.bind (Option.map and (some valโ)) fun g => Option.map g none) = do let __do_lift โ some valโ let __do_lift_1 โ none pure (__do_lift && __do_lift_1)
mk.mk.some.some(Option.bind (Option.map and (some valโยน)) fun g => Option.map g (some valโ)) = do let __do_lift โ some valโยน let __do_lift_1 โ some valโ pure (__do_lift && __do_lift_1)
mk.mk(Option.bind (Option.map and (List.get? x i)) fun g => Option.map g (List.get? y i)) = do let __do_lift โ List.get? x i let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)
mk.mk.none.none(Option.bind (Option.map and none) fun g => Option.map g none) = do let __do_lift โ none let __do_lift_1 โ none pure (__do_lift && __do_lift_1)
mk.mk.none.some(Option.bind (Option.map and none) fun g => Option.map g (some valโ)) = do let __do_lift โ none let __do_lift_1 โ some valโ pure (__do_lift && __do_lift_1)
mk.mk.some.none(Option.bind (Option.map and (some valโ)) fun g => Option.map g none) = do let __do_lift โ some valโ let __do_lift_1 โ none pure (__do_lift && __do_lift_1)
mk.mk.some.some(Option.bind (Option.map and (some valโยน)) fun g => Option.map g (some valโ)) = do let __do_lift โ some valโยน let __do_lift_1 โ some valโ pure (__do_lift && __do_lift_1)
mk.mk(Option.bind (Option.map and (List.get? x i)) fun g => Option.map g (List.get? y i)) = do let __do_lift โ List.get? x i let __do_lift_1 โ List.get? y i pure (__do_lift && __do_lift_1)theoremGoals accomplished! ๐get?_ofInt_neg_one : (Bitvec.ofIntget?_ofInt_neg_one: โ {w i : โ}, List.get? (Vector.toList (Bitvec.ofInt w (-1))) i = if i โค w then some true else nonew (-w: ?m.3131951)).toList.get?1: ?m.313244i = ifi: ?m.313238i โคi: ?m.313238w then somew: ?m.313195true else none :=true: BoolGoals accomplished! ๐w, i: โList.get? (Vector.toList (Bitvec.ofInt w (-1))) i = if i โค w then some true else nonew, i: โList.get? (Vector.toList (true ::แตฅ Bitvec.not (Bitvec.ofNat w 0))) i = if i โค w then some true else nonew, i: โList.get? (Vector.toList (Bitvec.ofInt w (-1))) i = if i โค w then some true else nonew, i: โList.get? (Vector.toList (Bitvec.ofInt w (-1))) i = if i โค w then some true else nonew, i: โList.get? (Vector.toList (Bitvec.ofInt w (-1))) i = if i โค w then some true else nonew, i: โList.get? (Vector.toList (Bitvec.ofInt w (-1))) i = if i โค w then some true else none
inli < List.length (List.replicate (w + 1) true)
inli < List.length (List.replicate (w + 1) true)
inli < List.length (List.replicate (w + 1) true)
inli < List.length (List.replicate (w + 1) true)Goals accomplished! ๐w, i: โList.get? (Vector.toList (Bitvec.ofInt w (-1))) i = if i โค w then some true else none
inrList.length (List.replicate (w + 1) true) โค i
inrList.length (List.replicate (w + 1) true) โค iGoals accomplished! ๐-- from InstCombine/Shift:279 theoremGoals accomplished! ๐shl_ushr_eq_and_shl {shl_ushr_eq_and_shl: โ {w : โ} {x C : Bitvec (Nat.succ w)}, shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))w :w: โNat} {x C : BitvecNat: Typew.succ} : Bitvec.shl (Bitvec.ushr x C.toNat) C.toNat = Bitvec.and x (Bitvec.shl (Bitvec.ofIntw: โw (-w: โ1)) C.toNat) :=1: ?m.315986Goals accomplished! ๐shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))
hโ (i : โ), List.get? (Vector.toList (shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C))) i = List.get? (Vector.toList (Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C)))) ishl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))
hList.get? (Vector.toList (shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C))) i = List.get? (Vector.toList (Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C)))) ishl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))
hList.get? (Vector.toList (shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C))) i = List.get? (Vector.toList (Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C)))) i
h(if Bitvec.toNat C + i < Nat.succ w then List.get? (Vector.toList (ushr x (Bitvec.toNat C))) (Bitvec.toNat C + i) else if i < Nat.succ w then some false else none) = List.get? (Vector.toList (Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C)))) i
hList.get? (Vector.toList (shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C))) i = List.get? (Vector.toList (Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C)))) i
h(if Bitvec.toNat C + i < Nat.succ w then if Bitvec.toNat C + i < Vector.length x then if Bitvec.toNat C + i < Bitvec.toNat C then some false else List.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) else none else if i < Nat.succ w then some false else none) = List.get? (Vector.toList (Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C)))) i
hList.get? (Vector.toList (shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C))) i = List.get? (Vector.toList (Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C)))) i
h(if Bitvec.toNat C + i < Nat.succ w then if Bitvec.toNat C + i < Vector.length x then if Bitvec.toNat C + i < Bitvec.toNat C then some false else List.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) else none else if i < Nat.succ w then some false else none) = do let __do_lift โ List.get? (Vector.toList x) i let __do_lift_1 โ List.get? (Vector.toList (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))) i pure (__do_lift && __do_lift_1)
h(if Bitvec.toNat C + i < Nat.succ w then if Bitvec.toNat C + i < Vector.length x then if Bitvec.toNat C + i < Bitvec.toNat C then some false else List.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) else none else if i < Nat.succ w then some false else none) = do let __do_lift โ List.get? (Vector.toList x) i let __do_lift_1 โ List.get? (Vector.toList (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))) i pure (__do_lift && __do_lift_1)shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))
h(if Bitvec.toNat C + i โค w then if Bitvec.toNat C + i โค w then if Bitvec.toNat C + i < Bitvec.toNat C then some false else List.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) else none else if i โค w then some false else none) = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (if Bitvec.toNat C + i โค w then if Bitvec.toNat C + i โค w then some true else none else if i โค w then some false else none) fun __do_lift_1 => some (__do_lift && __do_lift_1)shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: Bitvec.toNat C + i < Bitvec.toNat C
h.inl.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: ยฌBitvec.toNat C + i < Bitvec.toNat C
h.inl.inrList.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: Bitvec.toNat C + i < Bitvec.toNat C
h.inl.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: Bitvec.toNat C + i < Bitvec.toNat C
h.inl.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: ยฌBitvec.toNat C + i < Bitvec.toNat C
h.inl.inrList.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)Goals accomplished! ๐w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: ยฌBitvec.toNat C + i < Bitvec.toNat C
h.inl.inrList.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: ยฌBitvec.toNat C + i < Bitvec.toNat C
h.inl.inrList.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)w: โ
x, C: Bitvec (Nat.succ w)
i: โ
hโ: Bitvec.toNat C + i โค w
hโ: ยฌBitvec.toNat C + i < Bitvec.toNat C
h.inl.inrList.get? (Vector.toList x) (Bitvec.toNat C + i - Bitvec.toNat C) = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some true) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)Goals accomplished! ๐
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (some (List.get (Vector.toList x) { val := i, isLt := ?h.inr.inl })) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inli < List.length (Vector.toList x)
h.inr.inlsome false = Option.bind (some (List.get (Vector.toList x) { val := i, isLt := ?h.inr.inl })) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inli < List.length (Vector.toList x)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inlsome false = Option.bind (some (List.get (Vector.toList x) { val := i, isLt := ?h.inr.inl })) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inli < List.length (Vector.toList x)
h.inr.inlsome false = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind (some false) fun __do_lift_1 => some (__do_lift && __do_lift_1)Goals accomplished! ๐
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)shl (ushr x (Bitvec.toNat C)) (Bitvec.toNat C) = Bitvec.and x (shl (Bitvec.ofInt w (-1)) (Bitvec.toNat C))
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind none fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrList.length (Vector.toList x) โค i
h.inr.inrnone = Option.bind none fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrList.length (Vector.toList x) โค i
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrnone = Option.bind none fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)
h.inr.inrList.length (Vector.toList x) โค i
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)Goals accomplished! ๐
h.inr.inrnone = Option.bind (List.get? (Vector.toList x) i) fun __do_lift => Option.bind none fun __do_lift_1 => some (__do_lift && __do_lift_1)Goals accomplished! ๐-- A lot of this should probably go to a differet file here and not Mathlib inductive Refinement {Goals accomplished! ๐ฮฑ :ฮฑ: Type uType u} : OptionType u: Type (u+1)ฮฑ โ Optionฮฑ: Type uฮฑ โฮฑ: Type uProp |Prop: TypebothSome {bothSome: โ {ฮฑ : Type u} {x y : ฮฑ}, x = y โ Refinement (some x) (some y)xx: ฮฑy :y: ฮฑฮฑ } :ฮฑ: Type ux =x: ฮฑy โ Refinement (somey: ฮฑx) (somex: ฮฑy) |y: ฮฑnoneAny {noneAny: โ {ฮฑ : Type u} {x? : Option ฮฑ}, Refinement none x?x? : Optionx?: Option ฮฑฮฑ} : Refinement noneฮฑ: Type ux? namespace Refinement theoremx?: Option ฮฑRefinement.refl {Refinement.refl: โ {ฮฑ : Type u} (x : Option ฮฑ), Refinement x xฮฑ:ฮฑ: Type uType u} : โType u: Type (u+1)x : Optionx: Option ฮฑฮฑ, Refinementฮฑ: Type uxx: Option ฮฑx :=x: Option ฮฑGoals accomplished! ๐ฮฑ: Type uโ (x : Option ฮฑ), Refinement x xRefinement x xฮฑ: Type uโ (x : Option ฮฑ), Refinement x xRefinement x xฮฑ: Type uโ (x : Option ฮฑ), Refinement x xฮฑ: Type u
noneRefinement none none
someRefinement (some valโ) (some valโ)ฮฑ: Type uโ (x : Option ฮฑ), Refinement x x
someRefinement (some valโ) (some valโ)ฮฑ: Type uโ (x : Option ฮฑ), Refinement x xฮฑ: Type uโ (x : Option ฮฑ), Refinement x xtheoremGoals accomplished! ๐Refinement.trans {Refinement.trans: โ {ฮฑ : Type u} (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x zฮฑ :ฮฑ: Type uType u} : โType u: Type (u+1)xx: Option ฮฑyy: Option ฮฑz : Optionz: Option ฮฑฮฑ, Refinementฮฑ: Type uxx: Option ฮฑy โ Refinementy: Option ฮฑyy: Option ฮฑz โ Refinementz: Option ฮฑxx: Option ฮฑz :=z: Option ฮฑGoals accomplished! ๐ฮฑ: Type uโ (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x zRefinement x zฮฑ: Type uโ (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x z
bothSomeRefinement (some xโ) z
noneAnyRefinement none zRefinement x z
bothSomeRefinement (some xโ) z
noneAnyRefinement none zRefinement x z
noneAny.bothSomeRefinement none (some yโ)
noneAny.noneAnyRefinement none zRefinement x z
bothSome.bothSomeRefinement (some xโ) (some yโ)
noneAny.bothSomeRefinement none (some yโ)
noneAny.noneAnyRefinement none zRefinement x z
noneAny.noneAnyRefinement none z
noneAny.noneAnyRefinement none z
noneAny.noneAnyRefinement none zGoals accomplished! ๐Goals accomplished! ๐ฮฑ: Type uโ (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x zฮฑ: Type uโ (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x zฮฑ: Type uโ (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x zฮฑ: Type uโ (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x zฮฑ: Type uโ (x y z : Option ฮฑ), Refinement x y โ Refinement y z โ Refinement x zGoals accomplished! ๐instance {instance: {ฮฑ : Type u} โ [inst : DecidableEq ฮฑ] โ DecidableRel Refinementฮฑ :ฮฑ: Type uType u} [DecidableEqType u: Type (u+1)ฮฑ] : DecidableRel (@Refinementฮฑ: Type uฮฑ) :=ฮฑ: Type uGoals accomplished! ๐DecidableRel RefinementDecidable (Refinement x y)DecidableRel Refinement
noneDecidable (Refinement none y)
someDecidable (Refinement (some valโ) y)Decidable (Refinement x y)
noneDecidable (Refinement none y)
someDecidable (Refinement (some valโ) y)Decidable (Refinement x y)
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))DecidableRel Refinement
none.noneDecidable (Refinement none none)
none.noneDecidable (Refinement none none)
none.someDecidable (Refinement none (some valโ))
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))
none.none.hRefinement none none
none.none.hRefinement none none
none.noneDecidable (Refinement none none)
none.someDecidable (Refinement none (some valโ))
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))Goals accomplished! ๐
none.someDecidable (Refinement none (some valโ))
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))DecidableRel Refinement
none.someDecidable (Refinement none (some valโ))
none.someDecidable (Refinement none (some valโ))
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))
none.some.hRefinement none (some valโ)
none.some.hRefinement none (some valโ)
none.someDecidable (Refinement none (some valโ))
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))Goals accomplished! ๐
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))DecidableRel Refinement
some.noneDecidable (Refinement (some valโ) none)
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))
some.none.hยฌRefinement (some valโ) none
some.none.hยฌRefinement (some valโ) none
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))
some.none.h
some.none.h
some.noneDecidable (Refinement (some valโ) none)
some.someDecidable (Refinement (some valโยน) (some valโ))Goals accomplished! ๐
some.someDecidable (Refinement (some valโยน) (some valโ))DecidableRel Refinement
some.someDecidable (Refinement (some valโยน) (some valโ))
some.someDecidable (Refinement (some valโยน) (some valโ))
some.someDecidable (Refinement (some val) (some val'))
some.someDecidable (Refinement (some valโยน) (some valโ))
some.some.isFalseDecidable (Refinement (some val) (some val'))
some.some.isTrueDecidable (Refinement (some val) (some val'))
some.someDecidable (Refinement (some valโยน) (some valโ))
some.some.isFalseDecidable (Refinement (some val) (some val'))
some.some.isFalseDecidable (Refinement (some val) (some val'))
some.some.isTrueDecidable (Refinement (some val) (some val'))
some.some.isFalse.hยฌRefinement (some val) (some val')
some.some.isFalse.hยฌRefinement (some val) (some val')
some.some.isFalseDecidable (Refinement (some val) (some val'))
some.some.isTrueDecidable (Refinement (some val) (some val'))ฮฑ: Type u
instโ: DecidableEq ฮฑ
val, val': ฮฑ
hโ: ยฌval = val'
h: Refinement (some val) (some val')
some.some.isFalse.hฮฑ: Type u
instโ: DecidableEq ฮฑ
val, val': ฮฑ
hโ: ยฌval = val'
h: Refinement (some val) (some val')
some.some.isFalse.h
some.some.isFalseDecidable (Refinement (some val) (some val'))
some.some.isTrueDecidable (Refinement (some val) (some val'))
some.some.isFalseDecidable (Refinement (some val) (some val'))
some.some.isTrueDecidable (Refinement (some val) (some val'))Goals accomplished! ๐
some.some.isTrueDecidable (Refinement (some val) (some val'))
some.someDecidable (Refinement (some valโยน) (some valโ))
some.some.isTrueDecidable (Refinement (some val) (some val'))
some.some.isTrueDecidable (Refinement (some val) (some val'))
some.some.isTrue.hRefinement (some val) (some val')
some.some.isTrue.hRefinement (some val) (some val')
some.some.isTrueDecidable (Refinement (some val) (some val'))
some.some.isTrue.h.aval = val'
some.some.isTrue.h.aval = val'
some.some.isTrueDecidable (Refinement (some val) (some val'))Goals accomplished! ๐Goals accomplished! ๐end Refinement infix:50 " โ " => RefinementGoals accomplished! ๐instance {instance: {w : โ} โ DecidableEq (Bitvec w)w :w: โNat} : DecidableEq (BitvecNat: Typew) :=w: โinferInstance theoreminferInstance: {ฮฑ : Sort ?u.341315} โ [i : ฮฑ] โ ฮฑtoInt_injective : โ {toInt_injective: โ {w : โ}, Function.Injective Bitvec.toIntw :w: โNat}, Function.Injective (Bitvec.toInt : BitvecNat: Typew โw: โโค) |โค: Type0, โจ[],0: โ_โฉ, โจ[], _โฉ, rfl => rfl |_: List.length [] = 0n+n: โ1, โจ1: โa::x,a: Boolhxโฉ, โจhx: List.length (a :: x) = n + 1b::y,b: Boolhyโฉ,hy: List.length (b :: y) = n + 1h =>h: Bitvec.toInt { val := a :: x, property := hx } = Bitvec.toInt { val := b :: y, property := hy }Goals accomplished! ๐n: โ
a: Bool
x: List Bool
hx: List.length (a :: x) = n + 1
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
h: (bif a then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := a :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := a :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))n: โ
a: Bool
x: List Bool
hx: List.length (a :: x) = n + 1
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
h: (bif a then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := a :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := a :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))
aVector.toList { val := a :: x, property := hx } = Vector.toList { val := b :: y, property := hy }n: โ
x: List Bool
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
hx: List.length (false :: x) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))
a.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := b :: y, property := hy }n: โ
x: List Bool
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
hx: List.length (true :: x) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))
a.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := b :: y, property := hy }n: โ
a: Bool
x: List Bool
hx: List.length (a :: x) = n + 1
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
h: (bif a then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := a :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := a :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))
aVector.toList { val := a :: x, property := hx } = Vector.toList { val := b :: y, property := hy }n: โ
x: List Bool
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
hx: List.length (false :: x) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))
a.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := b :: y, property := hy }n: โ
x: List Bool
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
hx: List.length (true :: x) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))
a.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := b :: y, property := hy }n: โ
a: Bool
x: List Bool
hx: List.length (a :: x) = n + 1
b: Bool
y: List Bool
hy: List.length (b :: y) = n + 1
h: (bif a then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := a :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := a :: x, property := hx }))) = bif b then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := b :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := b :: y, property := hy }))
aVector.toList { val := a :: x, property := hx } = Vector.toList { val := b :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.false.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.false.trueVector.toList { val := false :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.false.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.false.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.false.trueVector.toList { val := false :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: Bitvec.toNat { val := x, property := (_ : Nat.pred (List.length (false :: x)) = Nat.pred (Nat.succ (n + 0))) } = Bitvec.toNat { val := y, property := (_ : Nat.pred (List.length (false :: y)) = Nat.pred (Nat.succ (n + 0))) }
a.false.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.false.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.false.trueVector.toList { val := false :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (Vector.toList โ Bitvec.ofNat n) (Bitvec.toNat { val := x, property := (_ : Nat.pred (List.length (false :: x)) = Nat.pred (Nat.succ (n + 0))) }) = (Vector.toList โ Bitvec.ofNat n) (Bitvec.toNat { val := y, property := (_ : Nat.pred (List.length (false :: y)) = Nat.pred (Nat.succ (n + 0))) })
a.false.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.false.falseVector.toList { val := false :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.false.trueVector.toList { val := false :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }Goals accomplished! ๐n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.false.trueVector.toList { val := false :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.false.trueVector.toList { val := false :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (false :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := false :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.false.trueVector.toList { val := false :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }Goals accomplished! ๐n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (false :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif false then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := false :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := false :: y, property := hy }))
a.true.falseVector.toList { val := true :: x, property := hx } = Vector.toList { val := false :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }Goals accomplished! ๐n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: Bitvec.toNat (Bitvec.not { val := x, property := (_ : Nat.pred (List.length (true :: x)) = Nat.pred (Nat.succ (n + 0))) }) = Bitvec.toNat (Bitvec.not { val := y, property := (_ : Nat.pred (List.length (true :: y)) = Nat.pred (Nat.succ (n + 0))) })
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (Vector.toList โ Bitvec.ofNat n) (Bitvec.toNat (Bitvec.not { val := x, property := (_ : Nat.pred (List.length (true :: x)) = Nat.pred (Nat.succ (n + 0))) })) = (Vector.toList โ Bitvec.ofNat n) (Bitvec.toNat (Bitvec.not { val := y, property := (_ : Nat.pred (List.length (true :: y)) = Nat.pred (Nat.succ (n + 0))) }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }n: โ
x, y: List Bool
hx: List.length (true :: x) = n + 1
hy: List.length (true :: y) = n + 1
h: (bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: x, property := hx }))) else โ(Bitvec.toNat (Vector.tail { val := true :: x, property := hx }))) = bif true then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail { val := true :: y, property := hy }))) else โ(Bitvec.toNat (Vector.tail { val := true :: y, property := hy }))
a.true.trueVector.toList { val := true :: x, property := hx } = Vector.toList { val := true :: y, property := hy }Goals accomplished! ๐theoremGoals accomplished! ๐toInt_zero {toInt_zero: โ {w : โ}, Bitvec.toInt 0 = 0w :w: โNat} : (Nat: Type0 : Bitvec0: ?m.347902w).toInt =w: โ0 :=0: ?m.347934Goals accomplished! ๐w: โBitvec.toInt 0 = 0w: โ(match w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0w: โBitvec.toInt 0 = 0
zero(match Nat.zero, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0w: โ
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0w: โBitvec.toInt 0 = 0
zero(match Nat.zero, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0
zero(match Nat.zero, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0w: โ
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0Goals accomplished! ๐w: โBitvec.toInt 0 = 0w: โ
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0w: โ
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0w: โ
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0w: โ
succ(match Nat.succ w, 0 with | 0, x => 0 | Nat.succ n, v => bif Vector.head v then Int.negSucc (Bitvec.toNat (Bitvec.not (Vector.tail v))) else โ(Bitvec.toNat (Vector.tail v))) = 0@[simp] theorem toInt_eq_zero {Goals accomplished! ๐w :w: โNat} (Nat: Typeb : Bitvecb: Bitvec ww) :w: โb.toInt =b: Bitvec w0 โ0: ?m.350602b =b: Bitvec w0 :=0: ?m.350628Goals accomplished! ๐Bitvec.toInt b = 0 โ Bitvec.toInt b = Bitvec.toInt 0Bitvec.toInt b = 0 โ Bitvec.toInt b = 0theoremGoals accomplished! ๐toInt_one : โ {toInt_one: โ {w : โ}, 1 < w โ Bitvec.toInt 1 = 1w :w: โโ} (โ: Type_hw :_hw: 1 < w1 <1: ?m.350738w), Bitvec.toInt (w: โ1 : Bitvec1: ?m.350777w) =w: โ1 |1: ?m.350802w+2, _ =>w: โGoals accomplished! ๐Bitvec.toInt 1 = 1Bitvec.toInt 1 = 1Bitvec.toInt 1 = 1Bitvec.toInt 1 = 1Bitvec.toInt 1 = 1-- from InstCombine/:805 theorem {Goals accomplished! ๐w :w: โNat} {Nat: Typex : Bitvecx: Bitvec ww} (w: โhw :hw: w > 1w >w: โ1) (1: ?m.353519hx :hx: x โ 0x โx: Bitvec w0) : Bitvec.sdiv?0: ?m.35355211: ?m.353580x = Option.some (Bitvec.select (((x: Bitvec wx +x: Bitvec w1).toNat <1: ?m.3536163) ::แตฅ Vector.nil)3: ?m.353692xx: Bitvec w0) :=0: ?m.353747Goals accomplished! ๐Goals accomplished! ๐Goals accomplished! ๐theorem : (Bitvec.sdiv? (Bitvec.ofInt'Goals accomplished! ๐ww: ?m.3546181)1: ?m.354646x) โ Option.some (Bitvec.select ((Nat.blt (Bitvec.addx: ?m.354638x (Bitvec.ofNatx: ?m.354638ww: ?m.3546181)).toNat (Bitvec.ofNat1: ?m.354659ww: ?m.3546183).toNat) ::แตฅ Vector.nil)3: ?m.354669x (Bitvec.ofNatx: ?m.354638ww: ?m.3546180)) :=0: ?m.354680sorry def beq {sorry: ?m.354690w :w: โNat} (Nat: Typexx: Bitvec wy : Bitvecy: Bitvec ww) :w: โBool :=Bool: Typex =x: Bitvec wy def fromBool :y: Bitvec wBool โ BitvecBool: Type1 := fun1: ?m.354792b =>b: ?m.354805b ::แตฅ Vector.nil instance :b: ?m.354805CoeCoe: semiOutParam (Sort ?u.354849) โ Sort ?u.354848 โ Sort (max(max1?u.354849)?u.354848)Bool (BitvecBool: Type1) := โจfromBoolโฉ end Bitvec1: ?m.354851